﻿using B.S.Material.Domain.Production_rejection;
using B.S.Material.ErrorCode;
using B.S.Material.Read.Api.Applications.Command.StrippingCommand;
using B.S.Material.Read.Api.Applications.Command.StrippingDetailsCommand;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;

namespace B.S.Material.Read.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class GStrippingController : ControllerBase
    {
        private readonly IMediator mediator;
        private readonly ISqlSugarClient db;
        public GStrippingController(IMediator mediator, ISqlSugarClient db)
        {
            this.mediator = mediator;
            this.db = db;
        }
        /// <summary>
        /// 生产退料显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<ApiPaging<Stripping>>> GetStripping([FromQuery] GetStrippingCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<Stripping>>> FTStripping([FromQuery] FTStrippingCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料明细表显示
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<StrippingDetails>>> GetStrippingDetails([FromQuery] GetStrippingDetailsCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 生产退料明细表反填
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public async Task<ApiResult<List<StrippingDetails>>> FTStrippingDetails([FromQuery] FTStrippingDetailsCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
